home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / qbbs / rachad10.zip / CHGADDR.EPS < prev    next >
Text File  |  1990-08-05  |  17KB  |  859 lines

  1. A A
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.                            ChgAddr  V1.0
  49.           Network  Mail  Re-Addresser  for
  50.                            RemoteAccess
  51.  
  52.  
  53.  
  54.  
  55.              by  Marc  A.  Shannon,  129/45
  56.                          August  5,  1990
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.                               Chapter  1
  115.  
  116.                            Introduction
  117.  
  118.  
  119.        ChgAddr is a program  which  can  be  used with your RemoteAccess
  120.        system  to  "correct"  the  source  or  destination  Network Mail
  121.        address of any message in your RA message base in the first board
  122.        listed as being for "NetMail".  (See page 26 of  the RemoteAccess
  123.        documentation for information on  setting  up  a message area for
  124.        use with Network Mail.)
  125.  
  126.        Using  a simple configuration file, you  can  tell  ChgAddr  what
  127.        messages you want "altered" to suit your network setup.   You can
  128.        include  multiple  rules  to  suit  as many changes as you  need.
  129.        There is no limit on the number of rules you  can  include in the
  130.        configuration  file except for the limit  of  your  system's  (or
  131.        window's) memory size.
  132.  
  133.        As  with  most,  if not all, other software products available on
  134.        FidoNet, no guarantee is given  to the stability of this program.
  135.        It might trash your message base,  but  it probably won't.  All I
  136.        know is that it works on my system.
  137.  
  138.        The archive as sent out on SDSRA includes five files:
  139.  
  140.               CHGADDR.EXE  The actual executable program
  141.  
  142.               SAMPLE.CFG   A  sample configuration file which shows  use
  143.                            of the different possible rules
  144.  
  145.               CHGADDR.DOC  The documentation formatted for any  standard
  146.                            printer
  147.  
  148.               CHGADDR.EPS  The   documentation   formatted   for   Epson
  149.                            printers  (or  those which  emulate  standard
  150.                            Epson MX-80 codes)
  151.  
  152.               README       A brief summary of what ChgAddr does
  153.  
  154.        This program is somewhat ShareWare.   If  you use it and you like
  155.        it, you don't owe anything.   If  you  would like me to know that
  156.        you really like it, you may send in a small  amount  of money (no
  157.        more than $5 please) to:
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.             Marc Shannon
  175.             ChgAddr Donation
  176.             CMU P. O. Box 257
  177.             Pittsburgh, PA  15213-3890
  178.  
  179.        If you do send $5, I will, first of all, be interested in writing
  180.        future programs that  work  with RemoteAccess, and also will make
  181.        sure that I send you any new versions of ChgAddr  as  well as any
  182.        new  RA support programs that I write.    Alternatively,  if  you
  183.        would like, just send me a NetMail message and I'll be happy with
  184.        that.
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.                                      - 2 -
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.                               Chapter  2
  247.  
  248.           Requirements  and  restrictions
  249.  
  250.  
  251.        ChgAddr was written on a 80386-SX system running  MS-DOS  3.3 and
  252.        RemoteAccess 0.04a, but should work on any MS-DOS 3.x system with
  253.        RemoteAccess 0.03  or later (not including 1.00 which may require
  254.        a rewrite of the message-base structures).  ChgAddr is written in
  255.        C using  the  Turbo  C  2.0  compiler.   (If you're interested in
  256.        seeing my RASTRUCT.H file, you can FREQ it from 129/45.)
  257.  
  258.        In order to  run  ChgAddr,  you  only need to follow the standard
  259.        setup   procedures   for   RemoteAccess   and  then  create  your
  260.        configuration  file,  CHGADDR.CFG.     ChgAddr  will  check  your
  261.        environment for the RA variable.   If  found, it will use this to
  262.        find your RemoteAccess configuration and then  use  your message-
  263.        base path listed in there. If the RA environment variable  is not
  264.        found, ChgAddr will do all its work from the current directory.
  265.  
  266.        You should place your CHGADDR.CFG  file in the directory that the
  267.        RA environment variable points to.   (If  it is not found in that
  268.        directory, the current directory is also checked.)
  269.  
  270.        ChgAddr is only  16K  and  should  work fine in even the smallest
  271.        memory configuration.  (You may need more memory  for  ChgAddr to
  272.        run if you have zillions of rewrite rules, though.)
  273.  
  274.        At  its  peak,  ChgAddr only opens 4 files concurrently, which is
  275.        less than RemoteAccess opens.  ChgAddr will tell you, however, if
  276.        it  is  unable  to open a file needed for proper operation.  When
  277.        running,  it  always  opens the files with sharing options so it,
  278.        theoretically, could  be run in a multi-line situation.  Standard
  279.        DOS locks are taken out on the records being modified  to prevent
  280.        accidental conflicts.  This EonlyF works if any other programs with
  281.        access the message-base use these locking routines.
  282.  
  283.        It should be mentioned  that  this release of ChgAddr EDOES NOTF do
  284.        anything with respect to points.  Any point  values  specified in
  285.        the configuration file are flagged as invalid.
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.                                      - 3 -
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.                               Chapter  3
  313.  
  314.              Configuration  (rules)  file
  315.  
  316.  
  317.        This  is where the guts of the  ChgAddr  configuration  file  are
  318.        explained.
  319.  
  320.        First off, your configuration file should be placed either in the
  321.        directory where you plan to  run ChgAddr during your normal batch
  322.        file  processing  of  exporting  NetMail  messages  or   in  your
  323.        RemoteAccess system file  directory  (as defined by, and I'll say
  324.        it again, your RA environment variable).
  325.  
  326.        The ChgAddr configuration  file  is a "free-format" file with one
  327.        small exception.  You  may  include comments on any line when you
  328.        use a semicolon (;) in front of your comment text.  The exception
  329.        to  the   "free-format"  is  that  blank  lines  have  a  special
  330.        significance.
  331.  
  332.        Your configuration file  can  contain many "rules", each of which
  333.        can specify a certain address  match  with  certain  rewrites for
  334.        those matches.  Between each rule, you need to have a blank line.
  335.        You may include as many rewrite rules in  the  configuration file
  336.        as you need or want.  In processing, ChgAddr will only  apply the
  337.        EFIRSTF rewrite rule which matches the particular message.
  338.  
  339.        Each rewrite rule can include  up to four clauses: Old-From, Old-
  340.        To, New-From, and New-To.    The "old" clauses may contain one or
  341.        more  network  addresses  while  the  "new"  clauses  should only
  342.        contain one address.
  343.  
  344.        A fully specified rule could be shown as:
  345.  
  346.             [Old-From addr-list]
  347.             [Old-To addr-list]
  348.             [New-From addr]
  349.             [New-To addr]
  350.  
  351.        where the "addr-list" would  be  one  or more addresses, possibly
  352.        including  the  use  of  "All"  or "Except" phrases.  The  format
  353.        follows (as closely as possible) the format used  by  many mailer
  354.        programs which allow for multiple address specifications.  "addr-
  355.        list"  may  span  multiple lines provided that there is no clause
  356.  
  357.  
  358.                                      - 4 -
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.        keyword  in  the  middle  and  that  there  isn't  a  blank  line
  373.        separating the addresses. You'd  probably  better  check  out the
  374.        SAMPLE.CFG file for a  better  idea of what the address lists can
  375.        look like.
  376.  
  377.        Let's examine the use  of  the  Old-From  clause.  (The following
  378.        examples  are  taken  from  the  first  rule  in  the  SAMPLE.CFG
  379.        configuration file provided with the ChgAddr V1.0 archive.)
  380.  
  381.             Old-From 1:1/6
  382.  
  383.        This will match any message  which has its NetMail origin address
  384.        as 1:1/6.
  385.  
  386.             Old-To All Except 1:1/0 1 2 3 4 5
  387.                               6 8 10 11 12 102
  388.                               103 201 129/40
  389.  
  390.        This will match  any  message  which  is  not going to one of the
  391.        specified nodes in net 1:1 or going to 1:129/40.
  392.  
  393.        Note that for a successful match of any message,  both  the  Old-
  394.        From and Old-To clauses must  match successfully if they are both
  395.        supplied. (A rule with no "old" clauses will never  match  as  in
  396.        the second example in SAMPLE.CFG.)
  397.  
  398.             New-From 1:129/45
  399.  
  400.        This is an example of an action clause.    If  a  message matched
  401.        both the above  Old-From  and Old-To clauses, it's origin address
  402.        would be changed to be 1:129/45.
  403.  
  404.        If  we  wanted  to include other rewrite rules, they would follow
  405.        this one after a blank line in a similar manner to this example.
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.                                      - 5 -
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.                               Chapter  4
  445.  
  446.                     Method  of  operation
  447.  
  448.  
  449.        Here's a play-by-play list of exactly what ChgAddr does.
  450.  
  451.          1.  ChgAddr finds  out what your RA environment variable is set
  452.              to.  If it is undefined, the current directory is  used for
  453.              all the system file processing.
  454.  
  455.          2.  CONFIG.RA is then read to load  the  message-base directory
  456.              name as well as your system's primary network address.
  457.  
  458.          3.  Then, MESSAGES.RA  is  checked  for  your  systems  NetMail
  459.              board.   Note that ChgAddr only looks  to  find  the  first
  460.              message area which  is  marked for NetMail.  Any subsequent
  461.              ones are ignored!
  462.  
  463.          4.  At this point, your configuration file is read in.  ChgAddr
  464.              first checks the  current  directory and then looks in your
  465.              RA system  directory  (as  defined  by  the  RA environment
  466.              variable,   not   the   directory   specified  in  your  RA
  467.              configuration file).
  468.  
  469.          5.  Once your configuration file has been parsed  and converted
  470.              to  internal  rules,   ChgAddr  opens  up  MSGIDX.BBS  (for
  471.              reading) and MSGHDR.BBS (for reading and possible writing).
  472.              MSGINFO.BBS  is  read  in to get the statistics on how many
  473.              messages are on the NetMail board.
  474.  
  475.          6.  MSGIDX.BBS is scanned for any  messages  which  are  on the
  476.              NetMail board.  When one is found, MSGHDR.BBS  is  read for
  477.              that particular record.  These  conditions  are  checked to
  478.              see if a message qualifies for an address rewrite:
  479.                 -  The message is not deleted
  480.  
  481.                 -  The message is marked as "pending export"
  482.  
  483.                 -  The messages source and destination address match one
  484.                    of the rules listed in the ChgAddr configuration file
  485.  
  486.  
  487.  
  488.  
  489.  
  490.                                      - 6 -
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.          7.  If the message's address needs  to  be  rewritten,  the new
  505.              addresses are loaded  in  and the message header is written
  506.              back to the MSGHDR.BBS file.
  507.  
  508.          8.  Steps 6 and 7 are repeated until all the  messages  on  the
  509.              NetMail board have been checked.
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.                                      - 7 -
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.                               Chapter  5
  577.  
  578.               Error  levels  and  messages
  579.  
  580.  
  581.        Only three errorlevels are used by ChgAddr.   They  are described
  582.        below.
  583.  
  584.        Errorlevel 1 indicates that a  necessary system file could not be
  585.        opened.  A system error message is given with  this  showing  the
  586.        particular file and the reason why it could not be opened.
  587.  
  588.        Errorlevel 2 is used when an I/O error occurs during  the reading
  589.        or writing of one of the system files.
  590.  
  591.        Errorlevel  3  is  for  ChgAddr's  errors.  These  are  generally
  592.        configuration  errors.    A  message  is  printed  on the  screen
  593.        explaining the problem.
  594.  
  595.        Since the first two errorlevels  represent  standard  DOS errors,
  596.        the error messages printed on  the console should be fairly self-
  597.        explanatory  (or  you  can use your DOS reference manual for more
  598.        information).   Errorlevel 3 could include  a  number  of  errors
  599.        including:
  600.  
  601.             Syntax error on line #
  602.             While ChgAddr was parsing your configuration file,  it could
  603.             not understand  something  on  the  line  number  specified.
  604.             Check   your  configuration  file  for  possible  typos   or
  605.             incorrect network address punctuation.
  606.  
  607.             Net address format error on line #
  608.             A network address  has  not been completely specified.  This
  609.             could be from using something  similar  to  "1:13"  where no
  610.             node  number  has  been  specified;  you   may   have  meant
  611.             "1:13/All".
  612.  
  613.             ALL cannot be used here on line #
  614.             You have used the "All" phrase in an invalid context.   This
  615.             could  be  in  "1:129/45 All" where you  should  simply  say
  616.             "1:129/All".  Also, you cannot use "All" in your new-rewrite
  617.             lines (New-From and New-To).
  618.  
  619.  
  620.  
  621.  
  622.                                      - 8 -
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.             Keyword missing or invalid ("keyword") on line #
  637.             The keyword specified inside the  quotation  marks  has been
  638.             flagged as  invalid.    Check  for  misspellings  and proper
  639.             configuration file keywords.  It's  also  possible  that the
  640.             keyword was specified at  an  incorrect  time (such as using
  641.             "All" without specifying which pattern it is to match).
  642.  
  643.             Unrecognized keyword ("keyword") on line #
  644.             You have used a  keyword  in the right context, but it isn't
  645.             one  that ChgAddr knows about.  Check  the  chapter  on  the
  646.             configuration file  to ensure that you are using the correct
  647.             format.
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.                                      - 9 -
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.                               Chapter  6
  709.  
  710.                                 Support
  711.  
  712.  
  713.        Support?  You've got to be kidding!  Ha ha ha ha ha!
  714.  
  715.        Well, actually, like most authors,  I  am  interested  in finding
  716.        (and killing) bugs.  If you do have problems  with  this  program
  717.        and just can't seem to get it to  work  for  you,  send a copy of
  718.        your CHGADDR.CFG file along with a description of  the  error (or
  719.        non-error) that you're getting and I'll see what I can do.
  720.  
  721.        (In order to prevent  file  name  duplication, please rename your
  722.        configuration when sending it to something that I will be able to
  723.        identify with your node.)
  724.  
  725.        My  system,  1:129/45,  is  reachable  24  hours  a  day  running
  726.        FrontDoor all that time.  THIS  BOARD  IS  NOT A SUPPORT BBS.  If
  727.        you send me, via NetMail, your question or problem, I will answer
  728.        it  to  the  best of my ability, but I don't  have  any  suitable
  729.        online conferences or files that will help you.
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.                                      - 10 -
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.                         Table  of  Contents
  773.  
  774.  
  775.  
  776.  
  777.  
  778.             Chapter 1  Introduction                               1
  779.  
  780.             Chapter 2  Requirements and restrictions              3
  781.  
  782.             Chapter 3  Configuration (rules) file                 4
  783.  
  784.             Chapter 4  Method of operation                        6
  785.  
  786.             Chapter 5  Error levels and messages                  8
  787.  
  788.             Chapter 6  Support                                   10
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.                                        i
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.